package com.taiyi.renaissancemall.ui.main.first.goodSelect;

import android.graphics.Paint;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.taiyi.renaissancemall.R;
import com.taiyi.renaissancemall.bean.HotBrandBean;

import java.util.List;

public class GoodSelectItemAdapter extends BaseQuickAdapter<HotBrandBean.CartListBean.DetailsBean, BaseViewHolder> {
    public GoodSelectItemAdapter(int layoutResId, @Nullable List<HotBrandBean.CartListBean.DetailsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HotBrandBean.CartListBean.DetailsBean item) {
        ImageView img = helper.getView(R.id.iv_good_select_item_icon);
        Glide.with(mContext).load(item.smallimgurl).into(img);
        helper.setText(R.id.tv_good_select_item_name, item.name);
        TextView textView = helper.getView(R.id.tv_good_select_item_sPrice);
        textView.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
        String san = mContext.getString(R.string.symbolMoney) + item.sanfprice;
        textView.setText(san);
        TextView textView2 = helper.getView(R.id.tv_good_select_item_xPrice);
        String xia = mContext.getString(R.string.symbolMoney) + item.hyprice;
        textView2.setText(xia);
    }
}
